/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
header {
    background-color: #3498db;
    color: #fff;
    padding: 20px;
    text-align: center;
    border-radius: 5px 5px 0 0;
}

header h1 {
    font-size: 28px;
}

/* 导航样式 */
nav {
    background-color: #2980b9;
    padding: 10px 20px;
    margin-bottom: 20px;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #f1c40f;
}

/* 主要内容区域 */
main {
    flex: 1;
    padding: 20px;
}

section {
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

section h2 {
    color: #2980b9;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 欢迎区域 */
.welcome ul {
    margin-left: 20px;
    margin-top: 10px;
}

.welcome ul li {
    margin-bottom: 10px;
}

/* 消息提示区域 */
.message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px 15px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.message p {
    margin: 0;
}

/* 搜索区域 */
.search-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.search-container form {
    flex: 1;
    min-width: 300px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.form-group label {
    width: 100px;
    font-weight: bold;
    margin-right: 10px;
}

.form-group input,
.form-group select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

.form-group button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.form-group button:hover {
    background-color: #2980b9;
}

/* 表单区域 */
.form-section form {
    max-width: 600px;
    margin: 0 auto;
}

.form-section .form-group {
    margin-bottom: 20px;
    display: block;
}

.form-section .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    width: 100%;
}

.form-section .form-group input,
.form-section .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-section .form-group small {
    display: block;
    color: #777;
    margin-top: 5px;
    font-size: 12px;
}

.form-section .form-group button {
    padding: 10px 20px;
    font-size: 16px;
    margin-right: 10px;
}

/* 联系人列表 */
.contact-list table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.contact-list table th,
.contact-list table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.contact-list table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.contact-list table tr:hover {
    background-color: #f9f9f9;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #777;
    font-style: italic;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-edit {
    background-color: #2ecc71;
    color: white;
    margin-right: 5px;
}

.btn-edit:hover {
    background-color: #27ae60;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* 消息提示 */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 页脚样式 */
footer {
    background-color: #34495e;
    color: #ecf0f1;
    text-align: center;
    padding: 15px;
    margin-top: 30px;
    border-radius: 0 0 5px 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav ul li {
        margin: 5px 0;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-group label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .form-group button {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .contact-list table {
        display: block;
        overflow-x: auto;
    }
}